package park.gz.com.parkingfee.bean;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017-03-20.
 */

public class FeeHistory implements Serializable{
    private String car_no;//车号
    private String in_time;//入场时间
    private String in_image;//入场图片名称
    private String out_time;//出场时间
    private String out_image;//出场图片名称
    private String parked_time;//停车时长
    private String fee;//应收金额
    private String fact_fee;//实收金额
    private String card_type;//车辆类型
    private String stall_code;
    private String in_operator;//入场管理员
    private String out_operator;//出场管理员
    private String status;//车辆状态
    private String updated_at;//更新时间

    public String getCard_type() {
        return card_type;
    }

    public void setCard_type(String card_type) {
        this.card_type = card_type;
    }

    public String getStall_code() {
        return stall_code;
    }

    public void setStall_code(String stall_code) {
        this.stall_code = stall_code;
    }

    public String getIn_operator() {
        return in_operator;
    }

    public void setIn_operator(String in_operator) {
        this.in_operator = in_operator;
    }

    public String getOut_operator() {
        return out_operator;
    }

    public void setOut_operator(String out_operator) {
        this.out_operator = out_operator;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getUpdated_at() {
        return updated_at;
    }

    public void setUpdated_at(String updated_at) {
        this.updated_at = updated_at;
    }

    public String getOut_image() {
        return out_image;
    }

    public void setOut_image(String out_image) {
        this.out_image = out_image;
    }
    public String getFact_fee() {
        return fact_fee;
    }

    public void setFact_fee(String fact_fee) {
        this.fact_fee = fact_fee;
    }

    public String getCar_no() {
        return car_no;
    }

    public void setCar_no(String car_no) {
        this.car_no = car_no;
    }

    public String getIn_time() {
        return in_time;
    }

    public void setIn_time(String in_time) {
        this.in_time = in_time;
    }

    public String getIn_image() {
        return in_image;
    }

    public void setIn_image(String in_image) {
        this.in_image = in_image;
    }

    public String getOut_time() {
        return out_time;
    }

    public void setOut_time(String out_time) {
        this.out_time = out_time;
    }

    public String getParked_time() {
        return parked_time;
    }

    public void setParked_time(String parked_time) {
        this.parked_time = parked_time;
    }

    public String getFee() {
        return fee;
    }

    public void setFee(String fee) {
        this.fee = fee;
    }


    public static List<FeeHistory> parse(JSONArray jsonArray) throws JSONException{
        List<FeeHistory> feeHistoryList = new ArrayList<FeeHistory>();
        for (int i = 0;i<jsonArray.length();i++){
            JSONObject jsonObject = new JSONObject(jsonArray.get(i).toString());
            FeeHistory feeHistory = new FeeHistory();
            feeHistory.car_no = jsonObject.getString("car_no");
            feeHistory.in_time = jsonObject.getString("in_time");
            feeHistory.in_image = jsonObject.getString("in_image");
            feeHistory.out_time = jsonObject.getString("out_time");
            feeHistory.out_image = jsonObject.getString("out_image");
            feeHistory.parked_time = jsonObject.getString("parked_time");
            feeHistory.fee = jsonObject.getString("fee");
            feeHistory.fact_fee = jsonObject.getString("fact_fee");
            feeHistory.card_type = jsonObject.getString("card_type");
            feeHistory.stall_code = jsonObject.getString("stall_code");
            feeHistory.in_operator = jsonObject.getString("in_operator");
            feeHistory.out_operator = jsonObject.getString("out_operator");
            feeHistory.status = jsonObject.getString("status");
            feeHistory.updated_at = jsonObject.getString("updated_at");
            feeHistoryList.add(feeHistory);
        }
        return feeHistoryList;
    }
}
